const adminPermission = {
  code: 200,
  message: "获取权限成功",
  data: [
    {
      title: "首页",
    },
    {
      title: "工具列表",
      children: [
        {
          title: "记事本",
        },
        {
          title: "萤石云视频",
        },
      ],
    },
    {
      title: "商品管理",
      children: [
        {
          title: "商品列表",
        },
        {
          title: "商品详情",
        },
        {
          title: "订单列表",
        },
      ],
    },
    {
      title: "用户管理",
      children: [
        {
          title: "用户列表",
        },
        {
          title: "个人信息",
        },
       
      ],
    },
    {
      title: "商户管理",
      children: [
        {
          title: "商户列表",
        },
        {
          title: "商户详情",
        },
        {
          title: "新增商户",
        },
      ],
    },
    {
      title: "员工管理",
      children: [
        {
          title: "员工列表",
        },
      ],
    },
    {
      title: "发票管理",
      children: [
        {
          title: "申请开票",
        },
        {
          title: "开票记录",
        },
      ],
    },
  ],
};
const merchantPermission = {
  code: 200,
  message: "获取权限成功",
  data: [
    {
      title: "首页",
    },
    {
      title: "员工管理",
      children: [
        {
          title: "员工列表",
        },
      ],
    },
    {
      title: "发票管理",
      children: [
        {
          title: "申请开票",
        },
        {
          title: "开票记录",
        },
      ],
    },
  ],
};
const staffPermission = {
  code: 200,
  message: "获取权限成功",
  data: [
    {
      title: "首页",
    },
    {
      title: "发票管理",
      children: [
        {
          title: "申请开票",
        },
        {
          title: "开票记录",
        },
      ],
    },
  ],
};

function getPermissionRoutesAPI(req, res) {
  const token = req.body;
  switch (token.split("-")[0]) {
    case "admin":
      return adminPermission;
    case "merchant":
      return merchantPermission;
    case "staff":
      return staffPermission;
    default:
      return staffPermission;
  }
}

export default {
  getPermissionRoutesAPI,
};
